package com.niiwoo.civet.user.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description:
 * @Author:LiJian
 * @Date:2017/12/7
 */
@Getter
@AllArgsConstructor
public enum PlatformTypeEnum {

    NIIWOO(0, "你我金融"),
    RONG360(1, "融360");

    private Integer type;
    private String desc;

    public static PlatformTypeEnum enumOf(Integer type) {
        for (PlatformTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("未找到对应PlatformTypeEnum枚举，type：" + type);
    }
}
